import java.io.*;
import java.util.Scanner;


public class Main {
	
	public static void main(String args[]){
		Main main = new Main();
		Scanner scan = new Scanner(System.in);
		System.out.println("Enter the key");
		String key = scan.nextLine();
		key="==="+key+"===";
		main.get(key);
		//System.out.println("result "+main.get(key));
		}
	
	public String get(String key){
		System.out.println(key);
		String result=null;
		File file = new File("testfile.txt");
		FileReader fread = null;
		try {
			fread = new FileReader(file);
		} catch (FileNotFoundException e) {
			System.out.println("File not found exception");
		}		
		StreamTokenizer stok = new StreamTokenizer(fread);
		stok.wordChars(61, 61);
		
		try {
			while (stok.nextToken()!= StreamTokenizer.TT_EOF){
				if (key.equals(stok.sval)){
					stok.nextToken();
					result = stok.sval;
					System.out.println(result);					
				}
				
//				if (key.equals(stok.sval)){
//					stok.nextToken();
//					value = stok.sval;
//					System.out.println(value);
//				}
				//System.out.println(stok.sval);
				//System.out.println(String.valueOf((char)stok.ttype));
//				if (stok.sval.contains("=")){
//					System.out.println(stok.sval);
//				}
			}
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		return result;
	}

}
